{extend name="common/layout" /}
{block name="style"}{/block}

{block name="content"}

<script src="__SHOP_RESOURCE__/js/search_goods.js"></script>
<link href="__SHOP_DEFAULT__/css/layout.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
	body { _behavior: url(__SHOP_RESOURCE__/css/csshover.htc);}
</style>
<link rel="stylesheet" href="__SHOP_DEFAULT__/custom/css/search.css">

{include file="shop/common/cur_local" /}
<div class="wrapper nch-breadcrumb-layout">
	<?php if(!empty($nav_here) && is_array($nav_here)) {?>
		<div class="nch-breadcrumb">
		<?php foreach ($nav_here as $k=>$value) {?>
			<span class="arrow">&gt;</span>
 			<span class="sort-box"> 
 				<a href="{:url('index', array('cate_id' => $value['curr_cate_id']))}" class="current">
 					<?php echo $value['curr_cate_name'];?><i class="drop-arrow"></i>
 				</a> 

  				<div class="sort-sub">
   					<?php if (!empty($value['cate_array'])&&is_array($value['cate_array'])) {?>
    				<ul>
			        <?php foreach ($value['cate_array'] as $vc) { ?>
			  		<?php if($vc['gc_id']!=$value['curr_cate_id']){?>
			        	<li>
			        		<a href="{:url('index', array('cate_id' => $vc['gc_id']))}">
			        			<?php echo $vc['gc_name'];?>
			        		</a>
			        	</li>
			        <?php }?>
			  		<?php }?>
			        </ul>
    				<?php }?>
  				</div>
 
   			</span>
   		<?php }?>
   		</div>
   <?php }?>
	<div class="clear"></div>
</div>
  	
  	
<div class="nch-container wrapper">

 	<!-- 分类下的推荐商品 -->
    <div id="gc_goods_recommend_div" class="wrapper"></div>
    <div class="nch-module">
      	<div class="title">
        	<h3>
          		{if (!empty($show_keyword))}
          			<em>{$show_keyword}</em> -->
          		{/if}
          		共{$goods_num}件相关商品
          	</h3>
      	</div>
		<div class="content">
        	<div class="nch-module-filter">	
				<!--<dl>
            		<dt><span>商品所在地：</span> </dt>
            		<dd class="list">
              			<ul>
				            {if($flag == 0)}
				                <li><a href="<?php echo replaceParam(array('areaid_1' => 0));?>">全国</a> </li>
				                <?php foreach ($province as $key => $value) { ?>
				                  	<li><a href="<?php echo replaceParam(array('areaid_1' => $value[0]));?> "> <?php echo $value[1];?></a>  </li>
				                <?php }?>
				            {/if}
				            {if($flag != 0)}
					      		<li><a href="<?php echo replaceParam(array('areaid_1' => 0));?>">不限</a> </li>
				                <li><a href="<?php echo replaceParam(array('areaid_3' => 0));?>">全市</a> </li>
				                <?php foreach ($city_list as $key => $value) { ?>
				                  	<li><a href="<?php echo replaceParam(array('areaid_3' => $value[0]));?> "> <?php echo $value[1];?></a>  </li>
				                <?php }?>
				            {/if}
				        </ul>
            		</dd>  
          		</dl>-->
    			<?php $dl=1;?>
    			<?php if((!empty($brand_array) && is_array($brand_array)) || (!empty($attr_array) && is_array($attr_array))){?>
	          		<?php if((isset($checked_brand) && is_array($checked_brand)) || (isset($checked_attr) && is_array($checked_attr))){?>
				        <dl nc_type="ul_filter">
				            <dt>您已选择：</dt>
				            <dd class="list">
				              	<?php if(isset($checked_brand) && is_array($checked_brand)){?>
				              	<?php foreach ($checked_brand as $key=>$val){?>
				              		<span class="selected" nctype="span_filter"><?php echo $lang['goods_class_index_brand'];?>:<em><?php echo $val['brand_name']?></em><i data-uri="<?php echo removeParam(array('b_id' => $key));?>">X</i></span>
				              	<?php }?>
				              	<?php }?>
				              	<?php if(isset($checked_attr) && is_array($checked_attr)){?>
				              	<?php foreach ($checked_attr as $val){?>
				              		<span class="selected" nctype="span_filter"><?php echo $val['attr_name'].':<em>'.$val['attr_value_name'].'</em>'?><i data-uri="<?php echo removeParam(array('a_id' => $val['attr_value_id']));?>">X</i></span>
				              	<?php }?>
				              	<?php }?>
				            </dd>
				        </dl>
	          		<?php }?>
	          		<?php if (!isset($checked_brand) || empty($checked_brand)){?>
	          		<?php if(!empty($brand_array) && is_array($brand_array)){?>
				        <dl>
				            <dt>品牌：</dt>
				            <dd class="list">
					            <ul class="nch-brand-tab" nctype="ul_initial" style="display:none;">
					                <li data-initial="all">
					                	<a href="javascript:void(0);">所有品牌<i class="arrow"></i></a>
					                </li>
					                <?php if (!empty($initial_array)) {?>
					                <?php foreach ($initial_array as $val) {?>
					                	<li data-initial="<?php echo $val;?>">
					                		<a href="javascript:void(0);"><?php echo $val;?><i class="arrow"></i></a>
					                	</li>
					                <?php }?>
					                <?php }?>
					            </ul>
				              	<div id="ncBrandlist">
					                <ul class="nch-brand-con" nctype="ul_brand">
					                	
					                  	<?php $i = 0;foreach ($brand_array as $k=>$v){ $i++; ?>
					                  		<li data-initial="<?php echo $v['brand_initial']?>" <?php if ($i > 14) {?>style="display:none;"<?php }?>>
					                  			<a href="<?php $b_id = ((I('param.b_id') != '' && intval(I('param.b_id')) != 0)?I('param.b_id').'_'.$k:$k); echo replaceParam(array('b_id' => $b_id));?>">
						                    	<?php if ($v['show_type'] == 0) {?>
						                    		<img src="{$v['brand_pic']}" alt="<?php echo $v['brand_name'];?>" /> 
						                    		<span><?php  echo $v['brand_name'];?></span>
						                    	<?php } else { echo $v['brand_name'];?>
						                    	<?php }?>
					                    		</a>
					                    	</li>
					                  	<?php }?>
					                </ul>
				              	</div>
				            </dd>
				            <?php if (count($brand_array) > 16){?>
				            <dd class="all">
				            	<span nctype="brand_show">
				            		<i class="icon-angle-down"></i>更多
				            	</span>
				            </dd>
				            <?php }?>
				        </dl>
	          		<?php $dl++; } ?>
	          		<?php }?>
          			<?php if(!empty($attr_array) && is_array($attr_array)){?>
          			<?php $j = 0; foreach ($attr_array as $key=>$val){ $j++; ?>
          			<?php if(!isset($checked_attr[$key]) && !empty($val['value']) && is_array($val['value'])){?>
				        <dl>
				            <dt><?php echo $val['name'];?>：</dt>
				            <dd class="list">
				              	<ul>
					                <?php $i = 0;foreach ($val['value'] as $k=>$v){ $i++; ?>
					                	<li {if ($i>10)}style="display:none" nc_type="none"{/if}><a href="<?php $a_id = ((I('param.a_id') != '' && I('param.a_id') != 0)?I('param.a_id').'_'.$k:$k); echo replaceParam(array('a_id' => $a_id));?>"><?php echo $v['attr_value_name'];?></a></li>
					                <?php }?>
				              	</ul>
				            </dd>
				            <?php if (count($val['value']) > 10){?>
				            	<dd class="all">
				            		<span nc_type="show">
				            			<i class="icon-angle-down"></i>更多
				            		</span>
				            	</dd>
				            <?php }?>
				        </dl>
			    	<?php }?>
			    	<?php $dl++;} ?>
			    	<?php }?>
			   	<?php }?>
        	</div>
      	</div>
      	
 	</div>
 
 
  <div class="left">
    	<?php if (!empty($goods_class_array)) {?>
    	<div class="nch-module nch-module-style02">
		    <div class="title">
		        <h3>商品分类</h3>
		    </div>
      		<div class="content">
		        <ul id="files" class="tree">
		          <?php foreach ($goods_class_array as $value) {?>
		          	<li>
		          		<i class="tree-parent tree-parent-collapsed"></i>
		          		<a href="{:url('shop/Search/index', array('cate_id' => $value['gc_id'], 'keyword' => I('param.keyword')))}" <?php if ($value['gc_id'] == I('param.cate_id')) {?>class="selected"<?php }?>>
		          			<?php echo $value['gc_name']?>
		          		</a>
		            <?php if (!empty($value['class2'])) {?>
		            <ul>
		              <?php foreach ($value['class2'] as $val) {?>
		              <li><i class="tree-parent tree-parent-collapsed"></i><a href="{:url('shop/Search/index', array('cate_id' => $val['gc_id'], 'keyword' => I('param.keyword')))}" <?php if ($val['gc_id'] == I('param.cate_id')) {?>class="selected"<?php }?>><?php echo $val['gc_name']?></a>
		                <?php if (!empty($val['class3'])) {?>
		                <ul>
		                  <?php foreach ($val['class3'] as $v) {?>
		                  <li class="tree-parent tree-parent-collapsed"><i></i><a href="{:url('shop/Search/index', array('cate_id' => $v['gc_id'], 'keyword' => I('param.keyword')))}" <?php if ($v['gc_id'] == I('param.cate_id')) {?>class="selected"<?php }?>><?php echo $v['gc_name']?></a></li>
		                  <?php }?>
		                </ul>
		                <?php }?>
		              </li>
		              <?php }?>
		            </ul>
		            <?php }?>
		          </li>
		          <?php }?>
		        </ul>
      		</div>
   		</div>
    	<?php }?>
    <!-- S 推荐展位 -->
   <!--  <div nctype="booth_goods" class="nch-module" style="display:none;"> </div> -->
    <!-- E 推荐展位 -->
    <!--<div class="nch-module">loadadv(37,'html')</div>-->
    <!-- 最近浏览 -->
    
    <div class="nch-module nch-module-style03">
      <div class="title">
        <h3>浏览历史</h3>
      </div>
      <div class="content">
        <div class="nch-sidebar-viewed" id="nchSidebarViewed">
          <ul>
            <?php if(!empty($viewed_goods) && is_array($viewed_goods)){?>
            <?php foreach ($viewed_goods as $k=>$v){?>
            <li class="nch-sidebar-bowers">
              <div class="goods-pic"><a href="{:url('shop/Goods/index', array('goods_id'=>$v['goods_id']))}" target="_blank"><img src="__SHOP_DEFAULT__/images/loading.gif" rel="lazy" data-url="<?php echo thumb($v, 60); ?>" title="<?php echo $v['goods_name']; ?>" alt="<?php echo $v['goods_name']; ?>" ></a></div>
              <dl>
                <dt><a href="{:url('shop/Goods/index', array('goods_id'=>$v['goods_id']))}" target="_blank"><?php echo $v['goods_name']; ?></a></dt>
                <dd>￥{$v['goods_promotion_price']}</dd>
              </dl>
            </li>
            <?php } ?>
            <?php } ?>
          </ul>
        </div>
        <a href="{:url('member/Goodsbrowse/index')}" class="nch-sidebar-all-viewed">全部浏览历史</a></div>
    </div>
  </div>
  <style type="text/css">
  	.goods-list-nav .category .menu li .recommend-class{
  			display: none;
  	}
  </style>
  <div class="right"> 

    <div class="shop_con_list" id="main-nav-holder">
      <nav class="sort-bar" id="main-nav">
         <div class="pagination">{$show_page1} </div>
        <div class="nch-all-category">
          <div class="all-category goods-list-nav">
          	{include file="common/all_nav" /}
          </div>
        </div>
        <div class="nch-sortbar-array"> 排序方式：
          <ul>
            <li <?php if(!I('param.key')){?>class="selected"<?php }?>><a href="<?php echo dropParam(array('order', 'key'));?>"  title="默认排序">默认</a></li>
            <li <?php if(I('param.key') == '1'){?>class="selected"<?php }?>><a href="<?php echo (I('param.order') == '2' && I('param.key') == '1') ? replaceParam(array('key' => '1', 'order' => '1')):replaceParam(array('key' => '1', 'order' => '2')); ?>" <?php if(I('param.key') == '1'){?>class="<?php echo I('param.order') == 1 ? 'asc' : 'desc';?>"<?php }?> title="<?php echo (I('param.order') == '2' && I('param.key') == '1')? '点击按销量从低到高排序':'点击按销量从高到低排序'; ?>">销量<i></i></a></li>
            <li <?php if(I('param.key') == '2'){?>class="selected"<?php }?>><a href="<?php echo (I('param.order') == '2' && I('param.key') == '2') ? replaceParam(array('key' => '2', 'order' => '1')):replaceParam(array('key' => '2', 'order' => '2')); ?>" <?php if(I('param.key') == '2'){?>class="<?php echo I('param.order') == 1 ? 'asc' : 'desc';?>"<?php }?> title="<?php  echo (I('param.order') == '2' && I('param.key') == '2')?'点击按人气从低到高排序':'点击按人气从低到高排序'; ?>">人气<i></i></a></li>
            <li <?php if(I('param.key') == '3'){?>class="selected"<?php }?>><a href="<?php echo (I('param.order') == '2' && I('param.key') == '3') ? replaceParam(array('key' => '3', 'order' => '1')):replaceParam(array('key' => '3', 'order' => '2')); ?>" <?php if(I('param.key') == '3'){?>class="<?php echo I('param.order') == 1 ? 'asc' : 'desc';?>"<?php }?> title="<?php echo (I('param.order') == '2' && I('param.key') == '3')?'点击按价格从低到高排序':'点击按价格从高到低排序'; ?>">价格<i></i></a></li>
          </ul>
        </div>
       <!--  <div class="nch-sortbar-filter" nc_type="more-filter">
       <span class="arrow"></span>
         <ul>
          <li><a href="<?php if (I('param.type') == 1) { echo dropParam(array('type'));} else { echo replaceParam(array('type' => '1'));}?>" <?php if (I('param.type') == 1) {?>class="selected"<?php }?>><i></i>平台自营</a></li>
          <li><a href="<?php if (I('param.gift') == 1) { echo dropParam(array('gift'));} else { echo replaceParam(array('gift' => '1'));}?>" <?php if (I('param.gift') == 1) {?>class="selected"<?php }?>><i></i>赠品</a></li>
           消费者保障服务
           <?php if($contract_item){?>
           <?php foreach($contract_item as $citem_k=>$citem_v){ ?>
           <li><a href="<?php if (in_array($citem_k,$search_ci_arr)){ echo removeParam(array('ci' => $citem_k));} else { echo replaceParam(array("ci" => $search_ci_str.$citem_k));}?>" <?php if (in_array($citem_k,$search_ci_arr)) {?>class="selected"<?php }?>><i></i><?php echo $citem_v['cti_name']; ?></a></li>
           <?php }?>
           <?php }?>
         </ul>
       </div> -->
        <!--<div class="nch-sortbar-location">商品所在地：
          <div class="select-layer">
            <div class="holder"><em nc_type="area_name">不限地区</em></div>
            <div class="selected"><a nc_type="area_name">不限地区</a></div>
            <i class="direction"></i>
            <ul class="options">

            </ul>
          </div>
        </div>-->
         <div class="pagination"></div>
      </nav>
      <!-- 商品列表循环  -->
      <div>
      	{include file="shop/common/goods_squares" /}
      </div>
      <div class="tc mt20 mb20">
        <div class="pagination"> {$show_page} </div>
      </div>
    </div>
    
    <!-- 猜你喜欢 -->
    <div id="guesslike_div" style="width:980px;"></div>
  </div>
  <div class="clear"></div>
</div>
<script src="__SITE_RESOURCE__/js/waypoints.js"></script> 
<script src="__SHOP_RESOURCE__/js/search_category_menu.js"></script> 
<script type="text/javascript" src="__SITE_RESOURCE__/js/fly/jquery.fly.min.js" charset="utf-8"></script> 
<!--[if lt IE 10]>
<script type="text/javascript" src="__SITE_RESOURCE__/js/fly/requestAnimationFrame.js" charset="utf-8"></script>
<![endif]-->
<script type="text/javascript">
var defaultSmallGoodsImage = '__UPLOAD_PATH__/shop/common/default_goods_image_240.gif';
var defaultTinyGoodsImage = '__UPLOAD_PATH__/shop/common/default_goods_image_60.gif';

$(function(){
    $('#files').tree({
        expanded: 'li:lt(2)'
    });
	//品牌索引过长滚条
	$('#ncBrandlist').perfectScrollbar({suppressScrollX:true});
    //浮动导航  waypoints.js
    $('#main-nav-holder').waypoint(function(event, direction) {
        $(this).parent().toggleClass('sticky', direction === "down");
        event.stopPropagation();
    });
	// 单行显示更多
	$('span[nc_type="show"]').click(function(){
		s = $(this).parents('dd').prev().find('li[nc_type="none"]');
		if(s.css('display') == 'none'){
			s.show();
			$(this).html('<i class="icon-angle-up"></i>收起');
		}else{
			s.hide();
			$(this).html('<i class="icon-angle-down"></i>更多');
		}
	});

	<?php if(intval(I('param.area_id')) > 0){?>
  // 选择地区后的地区显示
  $('[nc_type="area_name"]').html('<?php echo $province_array[intval(I('param.area_id'))]; ?>');
	<?php }?>

	<?php if(intval(I('param.cate_id')) > 0){?>
	// 推荐商品异步显示
    $('div[nctype="booth_goods"]').load('{:url("shop/Search/get_booth_goods", array("cate_id" => I("param.cate_id")))}', function(){
        $(this).show();
    });
	<?php }?>
	//浏览历史处滚条
	$('#nchSidebarViewed').perfectScrollbar({suppressScrollX:true});

	//猜你喜欢
	$('#guesslike_div').load('{:url("shop/Search/get_guesslike")}', function(){
        $(this).show();
    });

	//商品分类推荐
	$('#gc_goods_recommend_div').load('{:url("shop/Search/get_gc_goods_recommend", array("cate_id"=>$default_classid))}');
});
</script> 


{/block}